package com.example.springboottestservice;

import com.example.springboottestservice.cycle.CycleA;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;

//
@SpringBootApplication
@ComponentScan(basePackages = "com.example.springboottestservice.cycle")
@EnableAsync
@EnableAspectJAutoProxy
public class SpringBootTestServiceApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext run = SpringApplication.run(SpringBootTestServiceApplication.class, args);

		String[] beanDefinitionNames = run.getBeanDefinitionNames();

		System.out.printf("===================================\n");
		for (String beanDefinitionName : beanDefinitionNames) {
			System.out.println(beanDefinitionName);
		}

		CycleA bean = run.getBean(CycleA.class);
		System.out.println(bean);
		bean.test();
		//DefaultListableBeanFactory
	}

}
